(function(){
    $.modal.open({
        template:"comfirmDetail.html",
        canMove:false
    });
    var products={};
    products.openDetail=function(item){
        var instance=$.modal.open({template:"productDetail.html",
            controller:function(data){
                $.bindData.compileAll($('#modalProduct'),data);
            },
            data:item,
            canMove:true
        });
    };
    $.getJSON('getProducts',{pageNo:1,pageSize:20},function(data){
        products.data=data.data;
        $.bindData.compileAll($('#productTable'),products);
    });
})()


